home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-11-25 | 3.9 KB | 91 lines | [TEXT/MPS ] |
- ////////////////////////////////////////////////////////////////////////////////
- // OPEN SCRIPTING ARCHITECTURE: Generic Component Interface
- ////////////////////////////////////////////////////////////////////////////////
- // Copyright © 1992 Apple Computer, Inc. All rights reserved.
- // Authors: Jens Alfke, William Cook, Donn Denman, and Warren Harris
- ////////////////////////////////////////////////////////////////////////////////
- // This interface defines a "generic scripting component."
- // The Generic Scripting Component allows automatic dispatch to a
- // specific scripting component that conforms to the OSA interface.
- // This component supports OSA, by calling AppleScript or some other
- // scripting component. Additionally it provides access to the default
- // and the user-prefered scripting component.
- ////////////////////////////////////////////////////////////////////////////////
-
- #ifndef __OSAGeneric__
- #define __OSAGeneric__
-
- #ifndef __OSA__
- #include "OSA.h"
- #endif
-
- #define errOSAComponentIndeterminate -1760 // Can't determine proper component from parameters
- #define errOSAComponentMismatch -1761 // Parameters are from 2 different components
- #define errOSACantOpenComponent -1762 // Can't connect to scripting system with that ID
-
- #define kGenericComponentVersion 0x0060
-
- #define kGSSSelectGetDefaultScriptingSystem 0x1001 // == kOSASelectComponentSpecificStart
- #define kGSSSelectSetDefaultScriptingSystem 0x1002
- #define kGSSSelectGetScriptingComponent 0x1003
- #define kGSSSelectGetScriptingSystemFromStored 0x1004
- #define kGSSSelectGenericToRealID 0x1005
- #define kGSSSelectRealToGenericID 0x1006
- #define kGSSSelectMakeGenericContext 0x1007
- #define kGSSSelectOutOfRange 0x1008
-
- typedef OSType ScriptSystemSelector;
- typedef OSAID GenericID;
- typedef AEDesc OSAStoredScript;
-
- // get and set the default scripting system
- pascal OSAError
- GetDefaultScriptingSystem( ComponentInstance genericScriptingSystem,
- ScriptSystemSelector* scriptingSubType) // out
- = ComponentCallNow(kGSSSelectGetDefaultScriptingSystem, 4);
-
- pascal OSAError
- SetDefaultScriptingSystem( ComponentInstance genericScriptingSystem,
- ScriptSystemSelector scriptingSubType) // in
- = ComponentCallNow(kGSSSelectSetDefaultScriptingSystem, 4);
-
- // get a scripting system component instance from its subtype code
- pascal OSAError
- GetScriptingComponent( ComponentInstance genericScriptingSystem,
- ScriptSystemSelector scriptingSubType, // in
- ComponentInstance* scriptingInstance) // out
- = ComponentCallNow(kGSSSelectGetScriptingComponent, 8);
-
- // get a scripting system selector from a stored script
- pascal OSAError
- GetScriptingSystemFromStored( ComponentInstance genericScriptingSystem,
- const OSAStoredScript *scriptData, // in
- ScriptSystemSelector* scriptingSubType) // out
- = ComponentCallNow(kGSSSelectGetScriptingSystemFromStored, 8);
-
- // get a real component instance and script id from a generic id
- pascal OSAError
- GenericToRealID( ComponentInstance genericScriptingSystem,
- OSAID *theGenericScriptID, // in/out
- ComponentInstance *theExactComponent ) // out
- = ComponentCallNow(kGSSSelectGenericToRealID, 8);
-
- // get a generic id from a real component instance and script id
- pascal OSAError
- RealToGenericID( ComponentInstance genericScriptingSystem,
- OSAID *theRealScriptID, // in/out
- ComponentInstance theExactComponent ) // in
- = ComponentCallNow(kGSSSelectRealToGenericID, 8);
-
- // get a generic id from a real component instance and script id
- pascal OSAError
- MakeGenericContext( ComponentInstance genericScriptingSystem,
- const AEDesc *contextName, // in
- GenericID scriptID, // in
- GenericID *contextID ) // out
- = ComponentCallNow(kGSSSelectMakeGenericContext, 12);
-
- #endif // ifdef __GenericComponent__
- //////////////////////////////////////////////////////////////////////////////////////////////////////
-
-